home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / tcprogud.sit / TC Prog Guide / card_52189.txt < prev    next >
Text File  |  1991-02-27  |  1KB  |  31 lines

  1. -- card: 52189 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4755
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 6
  9. ----- text -----
  10. 7.2  File Inclusion
  11.  
  12. -- part contents for background part 4
  13. ----- text -----
  14. As mentioned earlier in this text, it is frequently convenient to place a list of declarations of user-defined data types and functions (as well as #defined names) in a separate "header" file which may be accessed by various other source files.  This is accomplished with the FILE INCLUSION preprocessor directive, usually placed at the beginning of a source file.  Its syntax is one of:
  15.  
  16.     # include      <standard library header file>
  17.     # include      "user-defined header file"
  18.  
  19. This directs the preprocessor to replace the '#include' line with all the text contained in the named file.  Using quotes instead of <> braces instructs the preprocessor to look for the file in the user's directory rather than that used by the system for standard header files.  For example, a source file using the printf() standard library function declared in the standard header 'stdio.h' and the user-defined type personnel_rec defined in the user's file 'personnel.h' should begin with:
  20.  
  21.     # include       <stdio.h>
  22.     # include       "personnel.h"
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29. -- part contents for background part 7
  30. ----- text -----
  31. 175